<?php
namespace app\controllers\common;

use app\controllers\common\BaseController;
use app\models\StudentPaper;
use yii\web\Controller;
use app\service\UrlService;
use app\models\User;
use app\models\Access;
use app\models\RoleAccess;
use app\models\UserRole;
use app\models\Visitlog;
use yii;
class ExaminationController extends BaseController
{

    public function paperinfo($studentpaperid){
        $res = StudentPaper::find()->where(['id'=>$studentpaperid])->asArray()->one();
        self::isempty($res);

        $res = yii\helpers\BaseJson::encode($res);
//        var_dump($res);
        return $this->returnJSON($res,'success',200);

    }

    //判断变量是否为空
    public static function isempty($var){
        if(empty($var)){
            echo $this->render('/error/error',['message'=>$var.'为空']);
            yii::$app->end();
        }
    }
}